import turtle
# from PyQt5.QtWidgets import *
t = turtle.Pen()
WIDTH,HEIGHT = 1100,1000
y_factor = 60
cut_factor = 20
turtle.setup(WIDTH,HEIGHT)
t.shape('turtle')
t.pensize(5)
t.speed(0)
def coordinate():
    def x():
        t.bk(400)
        t.fd(800)
        angle()
    def y():
        t.left(90)
        t.fd(400)
        angle()
        t.right(180)
        t.fd(800)
    def angle():
        t.left(135)
        t.fd(20)
        t.left(180)
        t.fd(20)
        t.right(90)
        t.fd(20)
        t.right(180)
        t.fd(20)
        t.right(45)
    x()
    t.bk(400)
    y()
coordinate()
t.penup()
x = -500
y = HEIGHT // 2 * -1
t.goto(x, y)
print('y:',y)
print('x:',x)
t.pendown()
for i in range(HEIGHT):
    if i == 0:
        t.penup()
        y = (2 * x ** 3 -4.5 * x ** 2) // y_factor + 5 * cut_factor
        t.pendown()
        pre_y = abs(y)
    y = (2 * x ** 3 -4.5 * x ** 2) // y_factor + 5 * cut_factor
    x += 2
    y += 10
    # print('y:',y)
    # print('x:',x)
    t.goto(x,y)
    if i >= 50 and abs(y) >= pre_y :
        break
turtle.done()